/*
	Copyright (c) 2012 by karmaleaving@qq.com. All rights RESERVED.
*/
#ifndef __H_VERSION_SSTD__
#define __H_VERSION_SSTD__

// DETECT SYSTEM {
#include <sys/types.h>
#if defined(_WIN32) || defined(_WIN)
#undef __CYGWIN__
#define _SSTD_WINDOWS_
#elif defined(__CYGWIN__)
#error test in windows
#define _SSTD_UNIX_
#else
#error undetected system
#endif
// DETECT SYSTEM }

#define override // for key <virtual>
typedef int diff_t; // replace ptrdiff_t

// KL_NAMESPACE {
#define SSTD cpp
#define SSTL_BEGIN namespace SSTD {
#define SSTL_END   }
// KL_NAMESPACE }

#include <string.h>
#include <stdio.h>

SSTL_BEGIN
// NATIVE TYPE {
typedef char      i1_t;
typedef short     i2_t;
typedef int       i4_t;
typedef long long i8_t;
typedef unsigned char      u1_t;
typedef unsigned short     u2_t;
typedef unsigned int       u4_t;
typedef unsigned long long u8_t;
#define INT_OK 0
struct Value
{
public:
	static const i4_t Zero = 0;
	static const i4_t I4_MAX = 0x7fffffff;
	static const i2_t I2_MAX = 0x7fff;
	static const i1_t I1_MAX = 0x7f;
	static const i4_t I4_MIN = ~I4_MAX;
	static const i2_t I2_MIN = ~I2_MAX;
	static const i1_t I1_MIN = ~I1_MAX;

	static const u4_t U4_MAX = 0xffffffff;
	static const u2_t U2_MAX = 0xffff;
	static const u1_t U1_MAX = 0xff;

	static const u4_t Oct = 010;
	static const u4_t Dec = 10;
	static const u4_t Hex = 0x10;
	static const size_t Npos = ~(size_t)0;
};
// NATIVE TYPE }
SSTL_END

#define ASSERT_REPAIR(A, B) if(!(A)) B
#define ASSERT(A) if(!(A)) throw "assert"

#endif // __H_VERSION_SSTD__
